Originally Posted by
User Name:
"-m32" tells gcc to produce code for 32 bit protected/compatibility mode. That has to do with the type of assembly it produces. Calling conventions are also different in 64 bit mode(the successor to 32 bit). And, like you mentioned, variable sizes are different in different modes.
"-mtune=*", from what I can tell, just narrows what processors gcc will optimize for(kinda like , with generic as you're using, gcc will avoid any SSE* or other instruction sets that were introduced after the 80386. Put simply, it's worthless, don't use it, unless you really know why you're using it.
Telling ld to link it as a pei-i386 will imply you want i386 code. And you would get errors if something was wrong that would cause the code not to be for the i386.
You're not going to get the same build to run on Linux and Windows. It's a problem of executable formats, the info in executables that describes to the OS how to load the executable into memory is OS specific, what's perfectly clear to NT will make no sense to Linux.
What Windows are you testing on, is it x86 or x64? And what Linux(i386 or x86-64)? I'll give you the exact command line to build with, but I have to know what mode those OSes are running in.